var Order = function () {
    return {
        Search: {
            search: function () {
                var data = $("#searchForm").serialize();
                Index.load("/admin/order/list/finished", data);
            }
        },
        Exporter: {
            export: function () {
                var data = $("#searchForm").serialize();
                window.location.href = "/admin/order/list/finished/export?" + data;
            }
        },
        Pagination: {
            goto: function (pageNo) {
                var form = $("#pageForm");
                $("#pageNo", form).val(pageNo);
                var data = form.serialize();
                Index.load("/admin/order/list/finished", data);
            }
        },
        Detail: {
            show: function (orderNo) {
                $.post("/admin/order/detail", {orderNo: orderNo}, function (data, xhr) {
                    $("#listRow").hide();
                    $("#detail").html(data).show();
                }, "text");
            },
            close: function () {
                $("#listRow").show();
                $("#detail").hide();
            }
        },
        Initializer: {
            refresh: function () {
                var pageNo = $("#pageNo", ("#pageForm")).val();
                Order.Pagination.goto(pageNo);
            },
            init: function () {
                // $(':checkbox').iCheck({
                //     checkboxClass: 'icheckbox_flat-blue',
                //     radioClass: 'iradio_flat-blue'
                // });

                Layout.fixContentHeight();
            }
        }
    };
}();